/*
*Copyright 2011-2020 enniu.com
*/
package com.zhanghaijun.web.controller;


import com.zhanghaijun.base.BaseController;
import com.zhanghaijun.domain.ZUserBean;
import com.zhanghaijun.dto.JsonResultDto;
import com.zhanghaijun.service.ZUserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author zhanghaijun 2015-07-21
 *         E-mail:zhanghaijun8755018@163.com
 */
@Controller
public class ZUserController extends BaseController {

    private static final String INDEX_TEMPLATE = "index";

    @RequestMapping(value = "/test/index2111.htm")
    public ModelAndView sayHelloWorld() {
        ModelAndView mav = new ModelAndView();
        ZUserBean zUserBean = zUserService.getById(1L);
        mav.addObject("zUserBean",zUserBean);
        mav.setViewName("index");
        return mav;
    }

    @RequestMapping(value = "/test/getlist.do")
    @ResponseBody
    public JsonResultDto getListData(){
        return new JsonResultDto(true,101,zUserService.getList());
    }


    @Autowired
    ZUserServiceImpl zUserService;
}
